<?php
namespace app\common\model;

use think\Model;
use think\Db;
class Plaform extends Model
{
    // 指定表名,不含前缀
    protected $name = 'plaform';

 
    public function getListByArg(array $arg=null,$field='*'){
        if (!is_array($arg))return false;
        $arg = $this->where($arg)->field($field)->select();
        return $arg;
    }
	public function getListByArgOne(array $arg=null,$field='*'){
        if (!is_array($arg))return false;
        $arg = $this->where($arg)->field($field)->find();
        return $arg;
    }
	
	public function getListByArgQbankid($qbankid){
		if(empty($qbankid)){
			return $qbankid;
		}

		$qbankid = explode(',',str_ireplace('|','',$qbankid));
		unset($qbankid['0']);
		$qb_id = Db::name('qbank')->where(['id'=>['in',$qbankid],'isdelete'=>'0'])->field('id')->select();
		$qbankids = '';
		foreach($qb_id as $v){
			$qbankids .= ','.$v['id'].'|';
		}

     
		
        return $qbankids;
    }
	
}
